package com.supcon.news.action.news;

import java.util.Map;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.supcon.news.service.NewsService;

public class ListNewsAction extends ActionSupport
{

	private static final long serialVersionUID = -626304435442019292L;
	private NewsService service;
	public NewsService getService()
	{
		return service;
	}

	public void setService(NewsService service)
	{
		this.service = service;
	}
	@SuppressWarnings("unchecked")
	@Override
	public String execute() throws Exception
	{
		Map request = (Map) ActionContext.getContext().get("request");
		request.put("list", service.findAll());
		return SUCCESS;
	}
	
}
